/**
*
* @file exception.h
*
* @brief Definitions of generic exception codes, and exception_throw() prototype.
*
* These are symbolic error codes for use with the try/catch/throw exception apparatus.
*
* Copyright ?2011 HID Corporation.  All rights reserved.
*
* This software is protected by copyright law and international treaties.
* Any unauthorized reproduction, distribution or use of the software is prohibited.
*
*/

#ifndef _exception_h
#define _exception_h

#define COMM_ERROR                                      0
#define CARD_NOT_FOUND                                  1
#define LISTREADER_ERROR                                2
#define NOT_SUPPORTED                                   3
#define TLV_NOT_FOUND                                   4
#define TLV_MALFORMED                                   5
#define ISO_EXCEPTION                                   6
#define PERSISTENT_UPDATE_ERROR                         7
#define OUT_OF_VOLATILE_MEMORY                          8
#define VOLATILE_MEMORY_TOO_FRAGMENTED                  9
#define VOLATILE_MEMORY_OBJECT_NOT_FOUND                10
#define PERSISTENT_TRANSACTION_ERROR                    11
#define PERSISTENT_WRITE_ERROR                          12
#define OUT_OF_PERSISTENT_MEMORY                        13
#define PERSISTENT_MEMORY_TOO_FRAGMENTED                14
#define PERSISTENT_MEMORY_OBJECT_NOT_FOUND              15
#define STORE_FULL                                      16
#define INVALID_STORE_OPERATION                         17
#define STORE_ACCESS_LOCKED                             18
#define TLV_INVALID_SETLENGTH                           19
#define TLV_INSUFFICIENT_BUFFER                         20
#define SNMP_INVALID_AUTHORITATIVE_ENGINE_ID            21
#define SNMP_INVALID_MESSAGE_SECURITY_FLAGS             22
#define SNMP_INVALID_MESSAGE_VERSION                    23
#define SNMP_INSUFFICIENT_BUFFER                        24
#define SNMP_INVALID_MESSAGE_AUTHENTICATION             25
#define SNMP_NOT_IN_TIME_WINDOW                         26
#define SNMP_INVALID_BOOT_AND_TIME                      27
#define SNMP_INVALID_USERNAME                           28
#define SNMP_INVALID_MESSAGE                            29
#define SNMP_INVALID_SECURITY_MODEL                     30
#define APPLICATION_EXCEPTION                           31
#define SLEEP_MODE_ENTER                                32
#define ISO7816_REPLAY                                  33

#define SIO_ERROR                                       34

#define CRYPTO_INVALID_DATA_LENGTH                      48
#define CRYPTO_INVALID_FUNCTION_USE                     49
#define CRYPTO_INVALID_PADDING                          50
#define CRYPTO_INSUFFICIENT_BUFFER                      51

#define ARTEMIS_EXCEPTION                               60

#define PICOREAD_BAD_CHECKSUM                           70
#define PICOREAD_PARITY_ERR                             71
#define PICOREAD_RCV_COLLISION                          72
#define PICOREAD_FIELD_ERROR                            73
#define PICOREAD_RESPONSE_TIMEOUT                       74
#define PICOREAD_BUFFER_OVERRUN                         75

#define TIMEOUT_ERROR                                   76

#define RF_ERROR                                        80

#define GET_ELMENT_OK                                        250

#define NO_EXCEPTION                                    255

#if 1
#include "cexcept.h"
define_exception_type(int);
extern struct exception_context the_exception_context[1];
#endif 

//#define Throw(x)	return (x)

#endif // _exception_h

///
